import { getMyCity } from '@/servers/index'
export default {
    namespace: 'common',
    state: {
      name:'sjy'
    },
    effects: {
      *testRequest({payload},{put,call}){
        let res = yield call(getMyCity, payload.data)
        // console.log(res)
        if (res.data.code === 'S000000') {
          yield put({
            type: 'changeName',
            payload: {
              name: '请求后的名字就叫后生'
            }
          })
        } else {
         console.log('else');
        }
        return res
      }
    },
  
    reducers: {
      changeName(state, { payload }) {
        return { ...state, ...payload }
      }
    }
  }